<template>
	<view>
		<z-paging ref="paging" v-model="list" @query="getPage" :auto="false">
			<cu-custom slot="top" :bgColor="'bg-' + theme.themeColor" :isBack="true">
				<block slot="content">我的评价</block>
			</cu-custom>
			<view v-for="(item,index) in list" :key="index">

				<view class="cu-item bg-white margin-bottom-sm">
					<view class="cu-list menu-avatar">
						<view class="cu-item">
							<view class="cu-avatar round lg" :style="'background-image:url(' + item.avatarUrl + ')'">
							</view>
							<view class="content flex-sub">
								<view>{{item.nickName}}</view>
								<view class="text-gray text-sm flex justify-between">
									{{item.createTime}}
								</view>
							</view>
						</view>
					</view>
					<view class="text-content padding-lr margin-tb-sm">
						{{item.content}}
					</view>
					<view class="grid flex-sub padding-lr col-3 grid-square">
						<view class="bg-img" :style="'background-image:url(' + itemPic + ')'"
							v-for="(itemPic,index) in item.picUrls" :key="index">
						</view>
					</view>
					<view v-if="item.replyTime && item.businessReply" class="light bg-grey padding-sm radius">
						<view>{{item.replyTime}}</view>
						卖家回复：{{item.businessReply}}
					</view>
				</view>
			</view>
		</z-paging>
	</view>

</template>

<script>
	import {
		getUserPage
	} from '@/api/goodsappraise.js';
	export default {
		data() {
			return {
				theme: getApp().globalData.theme,
				list: [],
			};
		},
		onLoad() {
			getApp().initPage().then(res => {
				this.$nextTick(function() {
					this.$refs.paging.reload();
				})
			})
		},
		methods: {
			/**
			 * 分页查询
			 */
			getPage(pageNo, pageSize) {
				getUserPage({
					current: pageNo,
					size: pageSize,
					descs: 'create_time',
				}).then(res => {
					this.$refs.paging.complete(res.data.records);
				});
			},
		}
	}
</script>

<style>
</style>
